package com.saifan.wyy_ov.ui.onlishop;

import java.util.List;

import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.view.ViewGroup;

/**
 * 商品图片栏适配器
 * @author wangli
 *
 */
public class GoodsPhotosPagerAdapter extends PagerAdapter{
	private List<View> views;
	public GoodsPhotosPagerAdapter(List<View> views){
		this.views = views;
	}
	@Override
	public int getCount() {
		 return views.size();
	}

	@Override
	public boolean isViewFromObject(View arg0, Object arg1) {
		return arg0 == arg1;
	}

	@Override
	public void destroyItem(ViewGroup container, int position, Object object) {
		container.removeView(views.get(position));
	}

	@Override
	public Object instantiateItem(ViewGroup container, int position) {
		container.addView(views.get(position), 0);
        return views.get(position);  
	}
}
